package com.wgts.wgts.dagger.module;

import com.wgts.wgts.dagger.scope.FragmentScope;
import com.wgts.wgts.mvp.model.ISearchResultFragmentModel;
import com.wgts.wgts.mvp.model.imp.SearchResultFragmentModel;
import com.wgts.wgts.mvp.presenter.ISearchResultFragmentPresenter;
import com.wgts.wgts.mvp.presenter.imp.SearchResultFragmentPresenter;
import com.wgts.wgts.mvp.view.ISearchResultFragmentView;
import com.wgts.wgts.netmodle.NetService;

import dagger.Module;
import dagger.Provides;

/*
 *
 *
 *   data:2018/9/2715:21
 *
 */
@Module
public class SearchResultFragmentModule {
    private ISearchResultFragmentView view;

    public SearchResultFragmentModule(ISearchResultFragmentView view) {
        this.view = view;
    }

    @Provides
    @FragmentScope
    public ISearchResultFragmentView provideView(){
        return view;
    }

    @Provides
    @FragmentScope
    public ISearchResultFragmentModel provideModel(NetService netService){
        return new SearchResultFragmentModel(netService);
    }

    @Provides
    @FragmentScope
    public ISearchResultFragmentPresenter providePresenter(ISearchResultFragmentModel model, ISearchResultFragmentView view){
        return new SearchResultFragmentPresenter(model, view);
    }
}
